package soundwave.com.demo.list;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;

import soundwave.com.demo.R;
import soundwave.com.demo.adpater.MyadressList_adapert;
import soundwave.com.demo.test.Myadresscontent_test;

/**
 * Created by xu on 2017/3/27.
 */

public class MyadressList extends Activity {
    private ListView addresslist;
    private TextView back;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myaddress);
        initView();

        ArrayList<Myadresscontent_test> adresscontent = new ArrayList<>();
        Myadresscontent_test myadresscontent_test = new Myadresscontent_test();
        myadresscontent_test.setAdress("");

        adresscontent.add(myadresscontent_test);

        MyadressList_adapert myadressList_adapert = new MyadressList_adapert(this, R.layout.myaddress_list, adresscontent);
        addresslist.setAdapter(myadressList_adapert);
        myadressList_adapert.notifyDataSetChanged();
        addresslist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

            }
        });
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });


    }

    private void initView() {
        addresslist = (ListView) findViewById(R.id.addresslist);
        back = (TextView) findViewById(R.id.back);

    }
}
